#include <iostream>
#include <boost/circular_buffer.hpp>
#include <boost/typeof/typeof.hpp>
using namespace boost;
using namespace std;

template <class T>
void print(const T &c) {
    //typedef typename T::value_type value_t;
    for (BOOST_AUTO(iter, c.begin()); iter != c.end(); ++iter) {
        cout << *iter << ",";
    }
    cout << endl;
}

int main()
{
    cout << "--- Start ---" << endl;
    circular_buffer<int> cb(4); 
    cout << cb.empty() << endl;
    cb.push_back(3);
    cb.push_front(2);
    cb.push_front(1);
    print(cb);

    cb.push_back(4);
    print(cb);

    cb.push_front(5);
    print(cb);

    cb.insert(cb.begin()+3, 7);
    print(cb);
    cout << "--- End ---" << endl;
    return 0;
}
